package com.regent.central.bill.service.bean.stock;

import com.regent.central.bill.core.storehouse.StockChangeSku;
import com.regent.central.bill.repository.storehouse.StockChangeSkuMapper;
import com.regent.central.bill.service.storehouse.StockChangeSkuService;
import com.regent.central.infrastructure.service.bean.DomainServiceBean;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Service
public class StockChangeSkuServiceBean extends DomainServiceBean<StockChangeSkuMapper, StockChangeSku> implements StockChangeSkuService {
    @Override
    public Map<String, Object> selectInventoryId(String skuId, String storehouseId, Date date) {
        Map<String, Object> goodsMap = new HashMap<String, Object>();
        goodsMap.put("skuId", skuId);
        goodsMap.put("storehouseId", storehouseId);
        goodsMap.put("date", date);
        return mapper.selectInventoryId(goodsMap);
    }

    @Override
    public void updateChangeNum(String skuId, String inventoryId, BigDecimal stock, String userId) {
        mapper.updateChangeNum(skuId, inventoryId, stock, userId);
    }
}
